﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using Uranus.ChinaService.Receives;

namespace Uranus.ChinaService
{
    /// <summary>
    /// ChinaReceive 的摘要说明
    /// </summary>
    public class ChinaReceive : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string cmdid = HttpContext.Current.Request["CmdId"];
            if (!string.IsNullOrEmpty(cmdid))
            {
                ChinaServiceCommon.WriteLogByContent(HttpContext.Current);
                ChinaServiceCommon.MethodRequest(cmdid, HttpContext.Current);
            }
            else if (!string.IsNullOrEmpty(HttpContext.Current.Request["RespType"]))
            {
                ChinaServiceCommon.WriteLogByContent(HttpContext.Current);
                if (HttpContext.Current.Request["RespType"] == "Cash")
                {
                    new TransferReceive(HttpContext.Current).AsyncCash();
                }
            }
            else
            {
                HttpContext.Current.Response.Write(ConfigurationManager.AppSettings["ChinaVersion"]);
                HttpContext.Current.Response.End();
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}